package com.yx.es.sync.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author lsx
 * @date 2025/3/3 15:14
 */
@Mapper
public interface DynamicTableMapper {

    @Select("SELECT * FROM ${tableName} WHERE ${primaryKey} > ${beginId} ORDER BY ${primaryKey} ASC LIMIT 500")
    List<Map<String, Object>> select(@Param("tableName") String tableName,
                                     @Param("primaryKey") String primaryKey,
                                     @Param("beginId") String beginId);

//    @Select("SELECT * FROM ${tableName} WHERE ${primaryKey} > ${beginId} AND winner_id > 0  ORDER BY ${primaryKey} ASC LIMIT 500")
//    List<Map<String, Object>> select(@Param("tableName") String tableName,
//                                     @Param("primaryKey") String primaryKey,
//                                     @Param("beginId") String beginId);
}
